home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form MoonList
- BackColor = &H00C0C0C0&
- Caption = "Moon Phases"
- ClientHeight = 1635
- ClientLeft = 3210
- ClientTop = 3180
- ClientWidth = 4380
- ControlBox = 0 'False
- Height = 2070
- Left = 3135
- LinkTopic = "Form2"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 1635
- ScaleWidth = 4380
- Top = 2820
- Width = 4530
- Begin CommandButton Command1
- Caption = "OK"
- Default = -1 'True
- Height = 330
- Left = 1590
- TabIndex = 0
- Top = 1020
- Width = 1170
- End
- Begin XListBox XList1
- Height = 1005
- ItemDefHeight = 100
- ItemInvert = -1 'True
- Left = 0
- Top = 0
- Width = 4365
- End
- Option Explicit
- Declare Function SendMessage Lib "User" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long
- Sub Command1_Click ()
- Unload Me
- End Sub
- Sub Form_Load ()
- Dim OurDate As Variant
- Dim IDt As Variant
- Dim Yr As Integer
- Dim I As Integer
- Dim T As Long
- Dim Sel As Integer
- Dim LongMinus$, LatMinus$
- Dim Sunrise$, Sunset$
- Dim TT$
- Dim Start%
- If Not gShowingMoons Then
- MoonList.Caption = "Sunrise & Sunset in " + gLocation
- If TextWidth(MoonList.Caption) > MoonList.Width Then
- MoonList.Width = TextWidth(MoonList.Caption) * 1.3
- End If
- End If
- If gSettingsVisible Then
- MoonList.Left = Settings.Left + (Settings.Width / 2) - (MoonList.Width / 2)
- MoonList.Top = Settings.Top + (Settings.Height / 2) - (MoonList.Height / 2)
- MoonList.Left = Screen.Width / 2 - (MoonList.Width / 2)
- MoonList.Top = Screen.Height / 2 - (MoonList.Height / 2)
- End If
- Screen.MousePointer = 11
- OurDate = Date
- Yr = Year(OurDate)
- If gShowingMoons Then
- Xlist1.ItemInvert = False
- gMoons = 0
- For I% = 1 To 12
- Call CalcMoonPhases(Yr, I%, 1, 0, True)
- Next I%
- Xlist1.ItemDefHeight = AlltheTime.MoonPic.Height
- For I = 1 To gMoons
- Xlist1.AddItem gMoonList$(I) + " - " + MoonDescArr$(gMoonSubs(I) - 35)
- Xlist1.ItemImage(I - 1) = AlltheTime.MoonSun.GraphicCell(gMoonSubs(I))
- If DateValue(gMoonList$(I)) <= DateValue(SavedDat$) Then
- Sel = I - 1
- End If
- Next I
- Xlist1.ItemInvert = True
- Xlist1.ItemDefHeight = AlltheTime.MoonPic.Height
- If Right$(gLongitude, 1) = "E" Then LongMinus$ = "-" Else LongMinus$ = ""
- If Right$(gLatitude, 1) = "S" Then LatMinus$ = "-" Else LatMinus$ = ""
- For I% = 1 To TZs%
- If InStr(TZ(I%), "(" + gTimezone + ")") <> 0 Then TT$ = TZ(I%)
- Next I%
- TT$ = Trim$(Mid$(TT$, InStr(TT$, ")") + 1, 200))
- Start = InStr(TT$, ":")
- If Start > 0 Then
- TT$ = Format$(Val(Left$(TT$, Start - 1)) + Val(Mid$(TT$, Start + 1, 200)) / 100#)
- End If
- For I% = -183 To 183
- If Val(gDSTAuto) Then
- Call CalcDSTStartStop(OurDate + I%)
- If (OurDate + I% >= DSTStart) And (OurDate + I% < DSTStop) Then
- gDST = "-1"
- Else
- gDST = "0"
- End If
- End If
- Call CalcSunRiseSet(LongMinus$ + Left$(gLongitude, Len(gLongitude) - 1), LatMinus$ + Left$(gLatitude, Len(gLatitude) - 1), Val(TT$), Val(gDST), OurDate + I%, Sunrise$, Sunset$)
- Xlist1.AddItem Format$(OurDate + I%, "Long Date") + " " + Sunrise$ + " " + Sunset$
- Next I%
- End If
- 'Show
- T& = SendMessage(Xlist1.hWnd, LB_SETCURSEL, 183, 0&)
- T& = SendMessage(Xlist1.hWnd, LB_SETTOPINDEX, 183, 0&)
- Screen.MousePointer = 0
- End Sub
- Sub Form_Resize ()
- Dim Items As Integer
- If Height < Command1.Height * 6.4 Then Height = Command1.Height * 6.4
- If Width < Command1.Width * 2 Then Width = Command1.Width * 2
- Xlist1.Width = ScaleWidth
- Command1.Left = (ScaleWidth - Command1.Width) / 2
- Command1.Top = (ScaleHeight - Command1.Height * 1.5)
- Xlist1.Height = Command1.Top - Command1.Height / 2
- Items = Xlist1.Height \ Xlist1.ItemDefHeight
- Xlist1.Height = Items * Xlist1.ItemDefHeight + 30
- 'Command1.Top = (ScaleHeight - Command1.Height * 1.5)
- End Sub
- Sub XList1_Click ()
- '
- End Sub
-